package com.chen.blog.mapper;

import com.chen.blog.model.Comment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author chen
 * @since 2022-01-24
 */
public interface CommentMapper extends BaseMapper<Comment> {

    /**
     * 根据博客id获取评论数量
     *
     * @param id
     * @param map
     * @return
     */
    Integer getCommentCountByBlogId(@Param("id") Integer id, @Param("map") Map<String, Object> map);

    /**
     * 根据博客id分页复合查询评论
     *
     * @param id
     * @param currentPage
     * @param pageSize
     * @param map
     * @return
     */
    List<Map<String, Object>> getCommentByBlogId(@Param("id") Integer id, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize, @Param("map") Map<String, Object> map);
}
